<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- 需要特别注意，此组件的静态文件不能运行，只有放在服务器上才能运行 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ajaxfileupload example</title>
<script type="text/javascript">
	var CTP_WEB_FULLPATH = "../../";
	var CTP_WEB_LANG = "zh_CN";
</script>
<script type="text/javascript"
	src="../../js/jquery/jquery.js"></script>
<script type="text/javascript" 
	src="../../js/jquery/jquery-migrate.js"></script>
<script type="text/javascript"
	src="../../js/jqueryui/jquery-ui.js"></script>
<script type="text/javascript"
	src="../../js/ctp/public/jsextend.js"></script>
<script type="text/javascript"
	src="../../js/ctp/public/ctp.core.js"></script>
<script type="text/javascript"
	src="../../js/ctp/public/ctp.base.js"></script>
<script type="text/javascript"
	src="../../js/ctp/public/ctp.ui.component.js"></script>
<script type="text/javascript"
	src="../../js/ctp/ajaxfileupload/uploadify/swfobject.js"></script>
<script type="text/javascript"
	src="../../js/ctp/ajaxfileupload/uploadify/jquery.uploadify.v2.1.0.js"></script>
<script type="text/javascript"
	src="../../js/ctp/ajaxfileupload/ctp.ui.ajaxfileupload.js"></script>
<script type="text/javascript"
	src="../../js/ctp/button/ctp.ui.button.js"></script>
<link rel="stylesheet" type="text/css"
	href="../../css/skins/standard/ctp-common.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/ajaxfileupload/default.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/ajaxfileupload/uploadify.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/ajaxfileupload/ajaxfileupload.css" />
<link rel="stylesheet" type="text/css"
	href="../../css/button.css" />

<script type="text/javascript">
	var ajaxfileup;
	alert("需要特别注意，此组件的静态文件不能运行，只有放在服务器上才能运行" );
	function test() {
		alert(ajaxfileup.get('fileExt'));
	}
	function test1() {
		ajaxfileup.set('fileExt', '*.doc');
	}
	$(window).load( function() {
		ajaxfileup = new ctp.ui.ajaxfileupload( {
			id :'fileuploadId',
			auto :false,
			height :'300px', //高度固定
			//height: 'auto', //高度自适应
			browserBtntext :'选择文件',
			uploadBtn :true,
			clearBtn :true,
			flowcUrl :'<ctp:url href="fileUpload/ajaxfileup.flowc"/>',
			flowActionName :'ajaxup',
			//simUploadLimit: 2,
			//queueSizeLimit: 5,
			//onSelect: function(fileID,fileObj){alert(fileObj.name)},
			//onSelectOnce : function(data){alert(data.fileCount)},
			//onRemove: function(fileID,fileObj,data){alert(fileObj.name+" : "+data.fileCount);},
			//onClearQueue : function(){return false;},
			//onQueueFull: function(queueSizeLimit){alert(queueSizeLimit);return false;},
			//onError: function(fileID,fileObj,errorObj){alert(fileObj.name+" : "+errorObj.type);return true;},
			//onUpload: function(){alert('upload');},
			//onOpen: function(fileID,fileObj){alert('open '+fileObj.name+' for upload');},
			//onProgress: function(fileID,fileObj,data){$('#labelId').text('uploading '+fileObj.name+' : '+data.percentage+' complete!');return true;},
			//onComplete: function(fileID,fileObj,response,data){alert(response);return true;},
			//onAllComplete: function(data){alert(data.filesUploaded);},
			//scriptData : {'flowActionName':'newfileup'},
			renderTo :'container'
		});
		//ajaxfileup.onSelect(function(fileID,fileObj){alert(fileObj.name)});
			//ajaxfileup.onSelectOnce(function(data){alert(data.fileCount)});
			//ajaxfileup.onRemove(function(fileID,fileObj,data){alert(fileObj.name+" : "+data.fileCount);});
			//ajaxfileup.onClearQueue(function(){return true;});
			//ajaxfileup.onQueueFull(function(queueSizeLimit){alert(queueSizeLimit);return false;});
			//ajaxfileup.onError(function(fileID,fileObj,errorObj){alert(fileObj.name+" : "+errorObj.type);return true;});
			//ajaxfileup.onUpload(function(){alert('upload');});
			//ajaxfileup.onOpen(function(fileID,fileObj){alert('open '+fileObj.name+' for upload');});
			//ajaxfileup.onProgress(function(fileID,fileObj,data){$('#labelId').text('uploading '+fileObj.name+' : '+data.percentage+' complete!');return true;});
			//ajaxfileup.onComplete(function(fileID,fileObj,response,data){alert(response);return true;});
			//ajaxfileup.onAllComplete(function(data){alert(data.filesUploaded);});
		});
</script>
</head>
<body>
<div id="container"></div>
<label id="labelId"></label>
<!-- <button onclick="test()">取值</button> -->
<!-- <button onclick="test1()">设值</button> -->
</body>
</html>